package com.servlet.user;

import com.service.user.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 创建作者 ：MySunshine
 * 创建时间 2022/10/27 14:08
 * 项目名称 SHUSHAN
 */
@WebServlet("/UserDeleteByNum")
public class UserDeleteByNum extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        UserServiceImpl usi = new UserServiceImpl();
        String num = req.getParameter("num");
        boolean b = usi.UserDeleteByNum(Integer.parseInt(num));
        if (b){
            System.out.println("删除成功！");
            resp.sendRedirect("/page/dba/dbaUserMge.jsp");
        }else {
            System.out.println("删除失败！");
        }
    }
}
